home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Peter's Final Project / src / point.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  2.3 KB  |  75 lines  |  [TEXT/KAHL]

  1. /*
  2.  *  Peter's Final Project -- A texture mapping demonstration
  3.  *  © 1995, Peter Mattis
  4.  *
  5.  *  E-mail:
  6.  *  petm@soda.csua.berkeley.edu
  7.  *
  8.  *  Snail-mail:
  9.  *   Peter Mattis
  10.  *   557 Fort Laramie Dr.
  11.  *   Sunnyvale, CA 94087
  12.  *
  13.  *  Avaible from:
  14.  *  http://www.csua.berkeley.edu/~petm/final.html
  15.  *
  16.  *  This program is free software; you can redistribute it and/or modify
  17.  *  it under the terms of the GNU General Public License as published by
  18.  *  the Free Software Foundation; either version 2 of the License, or
  19.  *  (at your option) any later version.
  20.  *
  21.  *  This program is distributed in the hope that it will be useful,
  22.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  *  GNU General Public License for more details.
  25.  *
  26.  *  You should have received a copy of the GNU General Public License
  27.  *  along with this program; if not, write to the Free Software
  28.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  */
  30.  
  31. #ifndef __POINT_H__
  32. #define __POINT_H__
  33.  
  34. #include "list.h"
  35. #include "type.defs.h"
  36. #include "matrix.vector.h"
  37.  
  38. POINT make_point (void);
  39. void free_point (POINT);
  40. POINT point_clone (POINT);
  41.  
  42. POINTS points_last (POINTS);
  43. POINTS points_append_point (POINTS, POINT);
  44. POINTS points_prepend_point (POINTS, POINT);
  45. void free_points (POINTS);
  46.  
  47. long point_mem_usage (void);
  48.  
  49. #define point_coord(p)      ((p)->coord)
  50. #define point_intensity(p)  ((p)->intensity)
  51.  
  52. #define point_x(p)      (vector_x(point_coord(p)))
  53. #define point_y(p)      (vector_y(point_coord(p)))
  54. #define point_z(p)      (vector_z(point_coord(p)))
  55. #define point_w(p)      (vector_w(point_coord(p)))
  56.  
  57. #define set_point_intensity(p, k)  (point_intensity(p) = (k))
  58.  
  59. #define set_point_x(p, k)   (point_x(p) = (k))
  60. #define set_point_y(p, k)   (point_y(p) = (k))
  61. #define set_point_z(p, k)   (point_z(p) = (k))
  62. #define set_point_w(p, k)   (point_w(p) = (k))
  63.  
  64. #define points_first(p)   ((POINT) list_datum((LIST) p))
  65. #define points_rest(p)    ((POINTS) list_next((LIST) p))
  66. #define points_prev(p)    ((POINTS) list_prev((LIST) p))
  67.  
  68. #define set_points_first(p, k)  (set_list_datum((LIST) p, k))
  69. #define set_points_rest(p, k)   (set_list_next((LIST) p, k))
  70. #define set_points_prev(p, k)   (set_list_prev((LIST) p, k))
  71.  
  72. #define points_add_point  points_prepend_point
  73.  
  74. #endif /* __POINT_H__ */
  75.